<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\GoldSubsidy
 *
 * @property int $id
 * @property int $user_id
 * @property string|null $origin
 * @property string|null $result
 * @property string|null $subsidies
 * @property string|null $remark
 * @property string|null $reason
 * @property string|null $data
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Database\Factories\GoldSubsidyFactory factory(...$parameters)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy query()
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereData($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereOrigin($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereReason($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereRemark($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereResult($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereSubsidies($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereUserId($value)
 * @mixin \Eloquent
 * @property string|null $money
 * @method static \Illuminate\Database\Eloquent\Builder|GoldSubsidy whereMoney($value)
 * @property-read \App\Models\User|null $user
 */
class GoldSubsidy extends Model
{
    use HasFactory;

    protected $guarded = ['id'];

    protected $casts = [
        'data' => 'json'
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
